<script setup lang="ts">
import { useRouter } from "vue-router"
/** 列表 */
const list = [
  { title: "控制端登录", url: "/console/login" },
  { title: "控制端首页", url: "/console/index" },
  { title: "客户端登录", url: "/client/login" },
  { title: "客户端首页", url: "/client/index" }
]
/** 跳转页面 */
function doPage(url: string) {
  useRouter().push({
    path: url
  })
}
</script>

<template>
  <el-row :gutter="20">
    <el-col :span="6" v-for="item in list">
      <el-card class="box-card">
        <template #header>
          <div class="card-header">
            <span>{{ item.title }}</span>
            <el-button class="button" @click="doPage(item.url)">跳转页面</el-button>
          </div>
        </template>
        <div>
          <span>{{ item.url }}</span>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>

<style lang="scss">
.el-row {
  padding: 10px 5px !important;
  margin: 0 !important;
}

.el-row:last-child {
  margin-bottom: 0;
}

.el-col {
  padding: 0 5px !important;
  margin-bottom: 10px;
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>
